feat(research): add read-only research agent and /research command to all profiles#3
Open
rasool404 wants to merge 1 commit into
Open
feat(research): add read-only research agent and /research command to all profiles#3rasool404 wants to merge 1 commit into
rasool404 wants to merge 1 commit into
Conversation
… all profiles Adds a new primary agent for researching external documentation, SDKs, APIs, and frameworks before implementation. Read-only (edit/write/bash denied) with .env read-deny patterns and prompt-level guards against secret exfiltration via websearch/webfetch. Ships to all 9 profiles: - 9x .opencode/agents/research.md (identical, md5-verified) - 9x .opencode/commands/research.md (identical, md5-verified) - 9x AGENTS.md (command row, agent bullet, cycle line updated) - 1x README.md (per-profile command table + shared-core sentence) Security: .env denied at permission level, prompt guards against prompt-injection exfiltration, all fetched content treated as untrusted.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds a new read-only
researchagent +/researchslash command to all 9 profiles in the pack. This fills a gap: the built-inexploreagent only searches the local codebase — nothing researches external docs, SDKs, APIs, or frameworks before implementation.The typical workflow cycle becomes: research → plan → implement → test → review → commit.
Why
When integrating a new SDK, API, or framework, the discovery/research phase is currently mixed into implementation. Developers either:
@backend/@frontendto "figure out the Stripe API and implement it" — context-switching between reading docs and writing codeA dedicated read-only research agent separates concerns: research produces a structured report, implementation consumes it. This matches the pack's existing pattern where
architectplans andbackend/frontendimplement.How
New files (18)
profiles/{9 profiles}/.opencode/agents/research.md— primary agent, read-onlyprofiles/{9 profiles}/.opencode/commands/research.md—/researchslash commandModified files (10)
profiles/{9 profiles}/AGENTS.md— command table row, agent bullet, cycle lineREADME.md— per-profile command table + shared-core sentenceAgent design
Mode:
primary(interactive, switchable via@researchor invoked via/research)Source priority:
context7MCP (live versioned docs) →webfetch(specific URLs) →websearch(discovery/comparisons)Output template: structured report with Target, Overview, Authentication, Key endpoints/workflows, SDK patterns, Limits & constraints, Recommended approach, References
Read-only enforcement:
edit: deny,write: deny,bash: deny— the agent cannot modify files or run shell commands. It produces a report and hands off tobackend/frontend/etc. for implementation.Security decisions
This is the first agent in the pack explicitly designed to fetch arbitrary external content, so it needed tighter guards than the existing primary agents:
.envread-deny at permission level —readuses per-pattern deny rules ("**/.env": deny,".env": deny, etc.) so the agent cannot read secret files even if prompted to. This is stricter thanarchitect/testerwhich use flatread: allow.Prompt-level exfiltration guard — three Rules bullets:
.envor secret contents (name env vars by key only, never by value)websearch/webfetch/context7queries (these go to external services)No
opencode.jsonchanges — agents are auto-discovered from.opencode/agents/, so no config file was touched.context7MCP is already enabled in every profile.Consistency verification
11b573fe...)2fa34471...)Testing
No test suite exists for this config pack. Verification was:
globconfirmed 18 new files in expected locationsmd5confirmed all agent/command files are identical across profilesgit diff --cached --statconfirmed only intended files staged (.envexcluded)Runtime verification (yours after merge): restart opencode, confirm
/researchappears in command list and@researchis switchable.Breaking changes
None. Purely additive — no existing agents, commands, configs, or permissions were modified.
Files